Application Manifest Resource

An Application Manifest is an XML file that describes and identifies the shared and private side-by-side assemblies that an application should bind to at run time. More detailed information can be found on the Microsoft MSDN site.

The following is an example of an application manifest for an application named MySampleApp.exe. The application consumes the Common Controls side-by-side assembly (COMCTL32).

<?xml version="1.0"
encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32"
                    name="myOrganization.myDivision.mySampleApp"
                    version="6.0.0.0"
                    processorArchitecture="x86"
                    publicKeyToken="6595b64144ccf1df"
  />
  <description>Your app description here</description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32"
                        name="Microsoft.Windows.Common-Controls"
                        version="6.0.0.0"
                        processorArchitecture="X86"
                        publicKeyToken="6595b64144ccf1df"
                        language="*"
      />
    </dependentAssembly>
  </dependency>
</assembly>

Elements

Names of elements and attributes are case-sensitive. The values of elements and attributes are case-insensitive, except for the value of the type attribute.

assembly

A container element. Its first subelement must be a noInherit or assemblyIdentity element. Required.

The assembly element has the following attributes.

Attribute

Description

manifestVersion

The manifestVersion attribute must be set to 1.0.


noInherit

Include this element in an application manifest to set the activation contexts generated from the manifest with the "no inherit" flag. When this flag is not set in an activation context, and the activation context is active, it is inherited by new threads in the same process, windows, window procedures, and Asynchronous Procedure Calls. Setting this flag prevents the new object from inheriting the active context.

The noInherit element is optional and typically omitted. Most assemblies do not work correctly using a no-inherit activation context because the assembly must be explicitly designed to manage the propagation of their own activation context. The use of the noInherit element requires that any dependent assemblies referenced by the application manifest have a noInheritable element in their assembly manifest.

If noInherit is used in a manifest, it must be the first subelement of the assembly element. The assemblyIdentity element should come immediately after the noInherit element. If noInherit is not used, assemblyIdentity must be the first subelement of the assembly element. The noInherit element has no child elements. It is not a valid element in assembly manifests.

assemblyIdentity

As the first subelement of an assembly element, assemblyIdentity describes and uniquely identifies the application owning this application manifest. As the first subelement of a dependentAssembly element, assemblyIdentity describes a side-by-side assembly required by the application. Note that every assembly referenced in the application manifest requires an assemblyidentity that exactly matches the assemblyIdentity in the referenced assembly's own assembly manifest.

The element has the following attributes. It has no subelements.

Attribute

Description

type

Specifies the application or assembly type. The value must be win32 and all in lower case. Required.

name

Uniquely names the application or assembly. Use the following format for the name: Organization.Division.Name. For example Microsoft.Windows.mysampleApp. Required.

language

Identifies the language of the application or assembly. Optional. If the application or assembly is language-specific, specify the DHTML language code.

In the assemblyIdentity of an application intended for worldwide use (language neutral) omit the language attribute.

In an assemblyIdentity of an assembly intended for worldwide use (language neutral) set the value of language to "*".

processorArchitecture

Specifies the processor. The valid values are x86 for 32-bit Windows and IA-64 for 64-bit Windows. Optional.

version

Specifies the application or assembly version. Use the four-part version format: mmmmm.nnnnn.ooooo.ppppp. Each of the parts separated by periods can be 0-65535 inclusive. Required.

publicKeyToken

A 16-character hexadecimal string representing the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. The public key used to sign the catalog must be 2048 bits or greater. Required for all shared side-by-side assemblies.


dependency

Contains at least one dependentAssembly. It has no attributes. Optional.

dependentAssembly

The first subelement of dependentAssembly must be an assemblyIdentity element that describes a side-by-side assembly required by the application. Every dependentAssembly must be inside exactly one dependency. It has no attributes.

file

Specifies files that are private to the application. Optional.

The element has the attributes shown in the following table.

Attribute

Description

name

Name of the file. For example, Comctl32.dll.

hashalg

Algorithm used to create a hash of the file. This value should be SHA1.

hash

A hash of the file referred to by name. A hexadecimal string of length depending on the hash algorithm.